Mark tests that need openpyxl
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Tue, 9 Dec 2025 11:19:37 +0000 (11:19 +0000)
committerGraham Inggs <ginggs@debian.org>
Tue, 9 Dec 2025 11:19:37 +0000 (11:19 +0000)
(These do the usual loop through engine/read_ext but
actually use .xlsx every time)

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name allow_no_openpyxl.patch

pandas/tests/io/excel/test_readers.py

index c62144adbaecbdd445a4171896e9ca2905f13205..63e8ce3b817a5f964521c5b04b95795d60eb218f 100644 (file)
@@ -1655,12 +1655,14 @@ class TestExcelFileRead:
         expected = pd.read_excel("test1" + read_ext, engine=engine)
         tm.assert_frame_equal(result, expected)
 
+    @td.skip_if_no("openpyxl")
     def test_read_excel_header_index_out_of_range(self, engine):
         # GH#43143
         with open("df_header_oob.xlsx", "rb") as f:
             with pytest.raises(ValueError, match="exceeds maximum"):
                 pd.read_excel(f, header=[0, 1])
 
+    @td.skip_if_no("openpyxl")
     @pytest.mark.parametrize("filename", ["df_empty.xlsx", "df_equals.xlsx"])
     def test_header_with_index_col(self, filename):
         # GH 33476